#ifndef _STM32_FLASH_H__
#define _STM32_FLASH_H__

#ifdef __cplusplus
extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/
#include <stdint.h>
#include "os/types.h"

int flash_erase_page(u32 address);
int flash_erase_pages(u32 address, u32 size);
int flash_write_page(u32 target_addr, uint8_t *data, u32 length, bool erase);
//bool flash_iap_need_erase(u32 address);
//void flash_write_magic(u32 magic);
//u32 flash_read_magic(void);
#ifdef __cplusplus
}
#endif

#endif //_STM32_FLASH_H__

